const { defineConfig } = require("@vue/cli-service");
const path = require("path");

function resolve(dir) {
  return path.join(__dirname, dir);
}

module.exports = defineConfig({
  pages: {
    index: {
      entry: "src/main.js",
      title: "氦星光联科技",
      template: "public/index.html",
      filename: "index.html",
    },
  },
  transpileDependencies: true,
  productionSourceMap: false,
  devServer: {
    /* 自动打开浏览器 */
    open: false,
    /* 跨域代理 */
    proxy: {
      "/api": {
        target: "http://haixing.dx.hdapp.com.cn/", // 接口的域名
        changeOrigin: true, // 如果接口跨域，需要进行这个参数配置
        pathRewrite: {
          "^/api": "/",
        },
      },
    },
  },
});
